<% @page_title = "Upload Your Vitae" %>

<%= render :partial => 'users/menu' %>

<div class="form_container column span-16 prepend-3 last">

  <h3><%= @page_title %></h3>

  <%= sourdough_error_messages_for :document %>
  <%= sourdough_error_messages_for :current_user %>
  <% form_for(:document, :url => upload_vitae_user_path(current_user), :html => { :multipart => true }) do |f| -%>
    <% if current_user.document && current_user.document.valid? && current_user.valid? %>
      <dl class="inline">
        <dt style="height:40px;">
        <label for="email">
          Current Vitae: <p class="delete"><%= link_to 'delete', delete_vitae_user_path(current_user), :confirm => 'Are you sure you want to remove your vitae from the site?', :method => :delete %></p>
        </label>
        </dt>
        <dd>
            <%= link_to current_user.document.filename, current_user.document.public_filename %>
        </dd>
      </dl>
    <% end %>
    <dl class="inline">
      <dt><%= label_for :user, :upload_new_vitae %></dt>
      <dd><%= f.file_field :uploaded_data %></dd>
    </dl>
    <hr />
    <p><%= submit_tag "Upload Your Vitae", :class => "submit" %></p>
  <% end %>

</div>
